//
//  HEDieaseItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/11/23.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEDieaseItemCell.h"

@interface HEDieaseItemCell ()

@property (nonatomic, strong) UILabel *titleLb;
@property (nonatomic, strong) UILabel *contentLb;

@end

@implementation HEDieaseItemCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _titleLb = [UILabel new];
    _titleLb.text = @"-";
    _titleLb.font = DYFont(15);
    _titleLb.textColor = CNavBgColor;
    [self.contentView addSubview: _titleLb];
    
    UIView *warp = [UIView new];
    warp.backgroundColor = CSplitLineColor;
    [self.contentView addSubview:warp];
 
    _contentLb = [UILabel new];
    _contentLb.text = @"-";
    _contentLb.font = DYFont(16);
    _contentLb.textColor = CNavLightBlackColor;
    _contentLb.numberOfLines = 0;
    [warp addSubview: _contentLb];
    
    [_titleLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView).mas_offset(10);
        make.right.equalTo(self.contentView).mas_offset(-10);
    }];
    
    [warp mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(_titleLb.mas_bottom).mas_offset(10);
        make.left.equalTo(self.contentView).mas_offset(10);
        make.right.equalTo(self.contentView).mas_offset(-10);
        make.bottom.equalTo(self.contentView).mas_offset(-10);
    }];
    
    [_contentLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(warp).mas_offset(10);
        make.left.equalTo(warp).mas_offset(10);
        make.right.equalTo(warp).mas_offset(-10);
        make.bottom.equalTo(warp).mas_offset(-10);
    }];
}

- (void)refreshContent:(GDFiterCellModel *)fiterModel formModel:(GDFormModel *)formModel indexPath:(NSIndexPath *)indexPath {
    _titleLb.text = fiterModel.leftTitle;
    _contentLb.text = formModel.ai_content[indexPath.row];
    
    _titleLb.textColor = fiterModel.leftTitleColor;
    _contentLb.textColor = fiterModel.contentColor;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
